package org.example;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class MyRateLimiterConfiguration {

    //配置限流器上下文
    @Bean
    public MyRateLimiterContext myRateLimiterContext(){
        System.out.println("配置限流器上下文");
        return new MyRateLimiterContext();
    }

    //配置限流器工厂
     @Bean
     public MyRateLimiterFactory myRateLimiterFactory() {
         return new MyRateLimiterFactory();
     }

     //aop
    @Bean
    public RateLimiterAspect rateLimiterAspect(){
        return new RateLimiterAspect();
    }

}
